package com.wh1200.mybatis.xmlless.resolver

import com.wh1200.mybatis.xmlless.config.BaseResolverTest
import com.wh1200.xmlless.test.model.SimpleStudent
import com.wh1200.xmlless.test.dao.StudentBaseMapperDAO
import org.junit.jupiter.api.Test
import kotlin.test.assertContains
import kotlin.test.assertNotNull

/**
 *
 * @author 吴昊
 * @date 2023/12/19 4:15
 * @since v0.0.0
 * @version 1.0
 */
class StudentBaseMapperResolver : BaseResolverTest(
    StudentBaseMapperDAO::class.java
) {

  @Test
  fun deleteById() {
    val method = StudentBaseMapperDAO::class.java.getMethod("deleteById", Object::class.java)
    val sql = createQueryForMethod(
        method
    ).sql
    assertNotNull(sql)
    assert(!sql.contains("<if test"))
    assertContains(sql, "= #{id}")
  }

}
